home *** CD-ROM | disk | FTP | other *** search
- Path: qualcomm.com!usenet
- From: nabbasi@qualcomm.com (Nasser Abbasi)
- Newsgroups: comp.lang.ada,comp.lang.c++
- Subject: Re: on OO differnces between Ada95 and C++
- Date: 22 Feb 1996 06:20:52 GMT
- Organization: QUalcomm Inc.
- Message-ID: <4gh204$l7n@qualcomm.com>
- References: <4gbq7q$g08@qualcomm.com> <Dn4J2F.uI@bton.ac.uk>
- Reply-To: x!news.be.innet.net!INbe.net!usenet
- NNTP-Posting-Host: annex-p32.qualcomm.com
- X-Newsreader: WinVN 0.90.4
-
- In article <Dn4J2F.uI@bton.ac.uk>, je@bton.ac.uk (John English) says:
- >
- >Nasser Abbasi (nabbasi@qualcomm.com) wrote:
- >: Lets also assume that we need to define a Money Type, defined in
- >: the base class Account.
- >
- >: In Ada95 this type is defined in the package Account.ads that also
- >: includes the definition of the tagged record type Account (along with
- >: operations that act on Account type).
- >
- >: Now, In Ada95, a client that wishes to use Saving_Account type (and
- >: any operations on it) will "with" the Saving_Account Package.
-
-
- >
- >If the spec of Saving_Account has "with Account" at the beginning,
- >"with Saving_Account" will imply "with Account".
-
- I do not think this is true. That is the main reason I asked the
- question in the first place. (I did not like having to "with"
- a package that was allready with'ed by a package I am "withing" ).
-
- If what you say was the case, then types defined in package "A"
- will be seen by clients to a package "B" where "B" has with'ed A. But
- it is not so. Clients of "B" must also 'with' "A" to see types defined
- in "A" even though "B: has allready with'ed "A".
-
- Thanks all for your inputs, I see 2 solutions now to this. I like the
- child package solution mentioned by a number of people (including
- John English).
-
- I also like the fact that withing Ada packages is not transitive. when
- I "with" Package A, only what is in A is visible, and not every thing
- that in the chain of packages that A might have "withed" (unless
- offcourse tagged types are involved). This way seems to give better
- control of things. In C/C++ including files A.h, will also "pull" in
- everthing that is included by A.h to the client level and make
- these things visible at the client level..
-
- Nasser
-
-